//
//  MyActivity.m
//  ActivityDemo
//
//  Created by 北京联动在线通讯科技有限公司 on 15-2-3.
//  Copyright (c) 2015年 北京联动在线通讯科技有限公司. All rights reserved.
//

#import "MyActivity.h"

@implementation MyActivity

-(instancetype)initWithImage:(UIImage *)shareImage atURL:(NSString *)URL atTitle:(NSString *)title atShareContentArray:(NSArray *)shareContentArray
{
    if(self = [super init]){
        _shareImage = shareImage;
        _URL = URL;
        _title = title;
        _getShareArray = [[NSArray alloc]initWithArray:shareContentArray];
    }
    return self;
}

+(UIActivityCategory)activityCategory
{
    return UIActivityCategoryShare;
}

-(NSString *)activityType
{
    return _title;
}

-(NSString *)activityTitle
{
    return _title;
}

-(UIImage *)activityImage
{
    return _shareImage;
}

-(BOOL)canPerformWithActivityItems:(NSArray *)activityItems
{
    return YES;
}

- (UIViewController *)activityViewController
{
    return nil;
}

-(void)performActivity
{
    if(nil == _title) {
        return;
    }
    NSLog(@"要分享的内容-----%@",_getShareArray);
    NSLog(@"分享的类型------ %@",_title);
    if([_title isEqualToString:@"share Renren"]){
        NSLog(@"---^^^   renren");
        //调用人人的sdk
    }else if([_title isEqualToString:@"share Sina"]){
        //调用新浪sdk
    }
}

@end
